package com.Studen.controller;

import com.Studen.bean.Score;
import com.Studen.servlet.DDLServlet;
import com.Studen.servlet.DDLServletMpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/show")
public class Show extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取前台传过来的id 用来查询成绩
        int show = Integer.parseInt(request.getParameter("u_id"));
        DDLServlet l = new DDLServletMpl();
        List<Score>score=l.show(show);
        request.setAttribute("score",score);
        request.getRequestDispatcher("ShowScore.jsp").forward(request,response);
    }
}
